<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Form Sumited</title>
</head>
<?php
	$reg_number = $_POST['reg.no.'];
	$rank = $_POST['rank'];
	$name = $_POST['name'];
	$father_name = $_POST['fathername'];
	$dob = $_POST['dob'];
	$course = $_POST['course'];
	$address = $_POST['address'];
	$city = $_POST['city'];
	$state = $_POST['state'];
	$category = $_POST['category'];
	$email = $_POST['email'];
	$sex = $_POST['sex'];


	$dbc = mysqli_connect('localhost', 'root', '', 'counseling_system')
		or die('Error connecting to MySQL server.');
			
	$query = "INSERT INTO `counseling_system`.`student_info` (`Reg_No.`, `Rank`, `Name`, `Father_name`, `Dob`, `Course`, `Address`,".
	" `City`, `State`, `Category`, `email`, `sex`) VALUES ('$reg_number', '$rank', '$name', '$father_name', '$dob', '$course', '$address', '$city',".
	" '$state', '$category', '$email', '$sex')";

	$result = mysqli_query($dbc,$query)
	or die('Error Querying Database');

	$mysqli_close($dbc);	 	
?>
<body>
</body>
</html>
